<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Literate programming</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Literate_programming"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.math.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.pygments.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Literate_programming rootpage-Literate_programming skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Literate programming</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<p class="mw-empty-elt">
</p>
<p><b>Literate programming</b> (<b>LP</b>) is a <a href="Programming_paradigm" title="Programming paradigm">programming paradigm</a> introduced in 1984 by <a href="Donald_Knuth" title="Donald Knuth">Donald Knuth</a> in which a <a href="Computer_program" title="Computer program">computer program</a> is given as an explanation of how it works in a <a href="Natural_language" title="Natural language">natural language</a>, such as English, interspersed (embedded) with <a href="Snippet_(programming)" title="Snippet (programming)">snippets</a> of <a href="Macro_(computer_science)" title="Macro (computer science)">macros</a> and traditional <a href="Source_code" title="Source code">source code</a>, from which <a href="Compiler" title="Compiler">compilable</a> source code can be generated.<sup id="cite_ref-TCJ_LP_1-0" class="reference"><a href="#cite_note-TCJ_LP-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> The approach is used in <a href="Scientific_computing" class="mw-redirect" title="Scientific computing">scientific computing</a> and in <a href="Data_science" title="Data science">data science</a> routinely for <a href="Reproducible_research" class="mw-redirect" title="Reproducible research">reproducible research</a> and <a href="Open_access" title="Open access">open access</a> purposes.<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> Literate programming tools are used by millions of programmers today.<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup>
</p><p>The literate programming paradigm, as conceived by Donald Knuth, represents a move away from writing computer programs in the manner and order imposed by the <a href="Compiler" title="Compiler">compiler</a>, and instead gives <a href="Programmer" title="Programmer">programmers</a> macros to develop programs in the order demanded by the logic and flow of their thoughts.<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> Literate programs are written as an exposition of logic in more <a href="Natural_language" title="Natural language">natural language</a> in which <a href="Macro_(computer_science)" title="Macro (computer science)">macros</a> are used to hide abstractions and traditional <a href="Source_code" title="Source code">source code</a>, more like the text of an <a href="Essay" title="Essay">essay</a>.
</p><p>Literate programming tools are used to obtain two representations from a source file: one understandable by a compiler or <a href="Interpreter_(computing)" title="Interpreter (computing)">interpreter</a>, the "tangled" code, and another for viewing as formatted <a href="Documentation" title="Documentation">documentation</a>, which is said to be "woven" from the literate source.<sup id="cite_ref-ObliqueScottReference_5-0" class="reference"><a href="#cite_note-ObliqueScottReference-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup> While the first generation of literate programming tools were <a href="Computer_language" title="Computer language">computer language</a>-specific, the later ones are <a href="Language-independent_specification" title="Language-independent specification">language-agnostic</a> and exist beyond the individual programming languages.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="History_and_philosophy">History and philosophy</h2></div>
<p>Literate programming was first introduced in 1984 by Donald Knuth, who intended it to create programs that were suitable literature for human beings. He implemented it at <a href="Stanford_University" title="Stanford University">Stanford University</a> as a part of his research on <a href="Algorithm" title="Algorithm">algorithms</a> and digital <a href="Typography" title="Typography">typography</a>. The implementation was called "<a href="Web_(programming_system)" title="Web (programming system)">WEB</a>" since he believed that it was one of the few three-letter words of English that had not yet been applied to computing.<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup> However, it resembles the complicated nature of software delicately pieced together from simple materials.<sup id="cite_ref-TCJ_LP_1-1" class="reference"><a href="#cite_note-TCJ_LP-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> The practice of literate programming has seen an important resurgence in the 2010s with the use of <a href="Notebook_interface" title="Notebook interface">computational notebooks</a>, especially in <a href="Data_science" title="Data science">data science</a>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Concept">Concept</h2></div>
<p>Literate programming is writing out the program logic in a human language with included (separated by a primitive markup) code snippets and macros. Macros in a literate source file are simply title-like or explanatory phrases in a human language that describe human abstractions created while solving the programming problem, and hiding chunks of code or lower-level macros. These macros are similar to the <a href="Algorithm" title="Algorithm">algorithms</a> in <a href="Pseudocode" title="Pseudocode">pseudocode</a> typically used in teaching <a href="Computer_science" title="Computer science">computer science</a>. These arbitrary explanatory phrases become precise new operators, created on the fly by the programmer, forming a <i>meta-language</i> on top of the underlying programming language.
</p><p>A <a href="Preprocessor" title="Preprocessor">preprocessor</a> is used to substitute arbitrary hierarchies, or rather "interconnected 'webs' of macros",<sup id="cite_ref-7" class="reference"><a href="#cite_note-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup> to produce the compilable source code with one command ("tangle"), and documentation with another ("weave"). The preprocessor also provides an ability to write out the content of the macros and to add to already created macros in any place in the text of the literate program source file, thereby disposing of the need to keep in mind the restrictions imposed by traditional programming languages or to interrupt the flow of thought.
</p>
<div class="mw-heading mw-heading3"><h3 id="Advantages">Advantages</h3></div>
<p>According to Knuth,<sup id="cite_ref-Knuth_8-0" class="reference"><a href="#cite_note-Knuth-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-9" class="reference"><a href="#cite_note-9"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup>
literate programming provides higher-quality programs, since it forces programmers to explicitly state the thoughts behind the program, making poorly thought-out design decisions more obvious. Knuth also claims that literate programming provides a first-rate documentation system, which is not an add-on, but is grown naturally in the process of exposition of one's thoughts during a program's creation.<sup id="cite_ref-10" class="reference"><a href="#cite_note-10"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup> The resulting documentation allows the author to restart their own thought processes at any later time, and allows other programmers to understand the construction of the program more easily. This differs from traditional documentation, in which a programmer is presented with source code that follows a compiler-imposed order, and must decipher the thought process behind the program from the code and its associated comments. The meta-language capabilities of literate programming are also claimed to facilitate thinking, giving a higher "bird's eye view" of the code and increasing the number of concepts the mind can successfully retain and process. Applicability of the concept to programming on a large scale, that of commercial-grade programs, is proven by an edition of <a href="TeX" title="TeX">TeX</a> code as a literate program.<sup id="cite_ref-Knuth_8-1" class="reference"><a href="#cite_note-Knuth-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup>
</p><p>Knuth also claims that literate programming can lead to easy porting of software to multiple environments, and even cites the implementation of TeX as an example.<sup id="cite_ref-11" class="reference"><a href="#cite_note-11"><span class="cite-bracket">[</span>11<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="Contrast_with_documentation_generation">Contrast with documentation generation</h3></div>
<p>Literate programming is very often misunderstood<sup id="cite_ref-MJD2000_12-0" class="reference"><a href="#cite_note-MJD2000-12"><span class="cite-bracket">[</span>12<span class="cite-bracket">]</span></a></sup> to refer only to formatted documentation produced from a common file with both source code and comments – which is properly called <a href="Documentation_generation" class="mw-redirect" title="Documentation generation">documentation generation</a> – or to voluminous commentaries included with code. This is the converse of literate programming: well-documented code or documentation extracted from code follows the structure of the code, with documentation embedded in the code; while in literate programming, code is embedded in documentation, with the code following the structure of the documentation.
</p><p>This misconception has led to claims that comment-extraction tools, such as the <a href="Perl" title="Perl">Perl</a> <a href="Plain_Old_Documentation" title="Plain Old Documentation">Plain Old Documentation</a> or <a href="Java_(programming_language)" title="Java (programming language)">Java</a> <a href="Javadoc" title="Javadoc">Javadoc</a> systems, are "literate programming tools". However, because these tools do not implement the "web of abstract concepts" hiding behind the system of natural-language macros, or provide an ability to change the order of the source code from a machine-imposed sequence to one convenient to the human mind, they cannot properly be called literate programming tools in the sense intended by Knuth.<sup id="cite_ref-MJD2000_12-1" class="reference"><a href="#cite_note-MJD2000-12"><span class="cite-bracket">[</span>12<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-13" class="reference"><a href="#cite_note-13"><span class="cite-bracket">[</span>13<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Workflow">Workflow</h2></div>
<p>Implementing literate programming consists of two steps:
</p>
<ol><li>Weaving: Generating a comprehensive document about the program and its maintenance.</li>
<li>Tangling: Generating machine executable code</li></ol>
<p>Weaving and tangling are done on the same source so that they are consistent with each other.
</p>
<div class="mw-heading mw-heading2"><h2 id="Example">Example</h2></div>
<p>A classic example of literate programming is the literate implementation of the standard <a href="Unix" title="Unix">Unix</a> <code><a href="Wc_(Unix)" title="Wc (Unix)">wc</a></code> word counting program. Knuth presented a <a href="CWEB" class="mw-redirect" title="CWEB">CWEB</a> version of this example in Chapter 12 of his <i>Literate Programming</i> book. The same example was later rewritten for the <a href="Noweb" title="Noweb">noweb</a> literate programming tool.<sup id="cite_ref-noweb-wc_14-0" class="reference"><a href="#cite_note-noweb-wc-14"><span class="cite-bracket">[</span>14<span class="cite-bracket">]</span></a></sup> This example provides a good illustration of the basic elements of literate programming.
</p>
<div class="mw-heading mw-heading3"><h3 id="Creation_of_macros">Creation of macros</h3></div>
<p>The following snippet of the <code>wc</code> literate program<sup id="cite_ref-noweb-wc_14-1" class="reference"><a href="#cite_note-noweb-wc-14"><span class="cite-bracket">[</span>14<span class="cite-bracket">]</span></a></sup> shows how arbitrary descriptive phrases in a natural language are used in a literate program to create macros, which act as new "operators" in the literate programming language, and hide chunks of code or other macros. The mark-up notation consists of double angle brackets (<code><<...>></code>) that indicate macros. The <code>@</code> symbol which, in a noweb file, indicates the beginning of a documentation chunk. The <code><<*>></code> symbol stands for the "root", topmost node the literate programming tool will start expanding the web of macros from. Actually, writing out the expanded source code can be done from any section or subsection (i.e. a piece of code designated as <code><<name of the chunk>>=</code>, with the equal sign), so one literate program file can contain several files with machine source code.
</p>
<div class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><pre><span class="n">The</span><span class="w"> </span><span class="n">purpose</span><span class="w"> </span><span class="n">of</span><span class="w"> </span><span class="n">wc</span><span class="w"> </span><span class="n">is</span><span class="w"> </span><span class="n">to</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="n">lines</span><span class="p">,</span><span class="w"> </span><span class="n">words</span><span class="p">,</span><span class="w"> </span><span class="n">and</span><span class="o">/</span><span class="n">or</span><span class="w"> </span><span class="n">characters</span><span class="w"> </span><span class="n">in</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="n">list</span><span class="w"> </span><span class="n">of</span><span class="w"> </span><span class="n">files</span><span class="p">.</span><span class="w"> </span><span class="n">The</span>
<span class="n">number</span><span class="w"> </span><span class="n">of</span><span class="w"> </span><span class="n">lines</span><span class="w"> </span><span class="n">in</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="n">file</span><span class="w"> </span><span class="n">is</span><span class="w"> </span><span class="p">........</span><span class="o">/</span><span class="n">more</span><span class="w"> </span><span class="n">explanations</span><span class="o">/</span>
<span class="n">Here</span><span class="p">,</span><span class="w"> </span><span class="n">then</span><span class="p">,</span><span class="w"> </span><span class="n">is</span><span class="w"> </span><span class="n">an</span><span class="w"> </span><span class="n">overview</span><span class="w"> </span><span class="n">of</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">file</span><span class="w"> </span><span class="n">wc</span><span class="p">.</span><span class="n">c</span><span class="w"> </span><span class="n">that</span><span class="w"> </span><span class="n">is</span><span class="w"> </span><span class="n">defined</span><span class="w"> </span><span class="n">by</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">noweb</span><span class="w"> </span><span class="n">program</span><span class="w"> </span><span class="n">wc</span><span class="p">.</span><span class="n">nw</span><span class="o">:</span>
<span class="w"> </span><span class="o"><<*>>=</span>
<span class="w"> </span><span class="o"><<</span><span class="n">Header</span><span class="w"> </span><span class="n">files</span><span class="w"> </span><span class="n">to</span><span class="w"> </span><span class="n">include</span><span class="o">>></span>
<span class="w"> </span><span class="o"><<</span><span class="n">Definitions</span><span class="o">>></span>
<span class="w"> </span><span class="o"><<</span><span class="n">Global</span><span class="w"> </span><span class="n">variables</span><span class="o">>></span>
<span class="w"> </span><span class="o"><<</span><span class="n">Functions</span><span class="o">>></span>
<span class="w"> </span><span class="o"><<</span><span class="n">The</span><span class="w"> </span><span class="n">main</span><span class="w"> </span><span class="n">program</span><span class="o">>></span>
<span class="w"> </span><span class="err">@</span>
<span class="n">We</span><span class="w"> </span><span class="n">must</span><span class="w"> </span><span class="n">include</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">standard</span><span class="w"> </span><span class="n">I</span><span class="o">/</span><span class="n">O</span><span class="w"> </span><span class="n">definitions</span><span class="p">,</span><span class="w"> </span><span class="n">since</span><span class="w"> </span><span class="n">we</span><span class="w"> </span><span class="n">want</span><span class="w"> </span><span class="n">to</span><span class="w"> </span><span class="n">send</span><span class="w"> </span><span class="n">formatted</span><span class="w"> </span><span class="n">output</span>
<span class="n">to</span><span class="w"> </span><span class="n">stdout</span><span class="w"> </span><span class="n">and</span><span class="w"> </span><span class="n">stderr</span><span class="p">.</span>
<span class="w"> </span><span class="o"><<</span><span class="n">Header</span><span class="w"> </span><span class="n">files</span><span class="w"> </span><span class="n">to</span><span class="w"> </span><span class="n">include</span><span class="o">>>=</span>
<span class="w"> </span><span class="cp">#include</span><span class="w"> </span><span class="cpf"><stdio.h></span>
<span class="w"> </span><span class="err">@</span>
</pre></div>
<p>The unraveling of the chunks can be done in any place in the literate program text file, not necessarily in the order they are sequenced in the enclosing chunk, but as is demanded by the logic reflected in the explanatory text that envelops the whole program.
</p>
<div class="mw-heading mw-heading3"><h3 id="Program_as_a_web">Program as a web</h3></div>
<p>Macros are not the same as "section names" in standard documentation. Literate programming macros hide the real code behind themselves, and be used inside any low-level machine language operators, often inside logical operators such as <code>if</code>, <code>while</code> or <code>case</code>. This can be seen in the following <code>wc</code> literate program.<sup id="cite_ref-noweb-wc_14-2" class="reference"><a href="#cite_note-noweb-wc-14"><span class="cite-bracket">[</span>14<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><pre><span class="n">The</span><span class="w"> </span><span class="n">present</span><span class="w"> </span><span class="n">chunk</span><span class="p">,</span><span class="w"> </span><span class="n">which</span><span class="w"> </span><span class="n">does</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">counting</span><span class="p">,</span><span class="w"> </span><span class="n">was</span><span class="w"> </span><span class="n">actually</span><span class="w"> </span><span class="n">one</span><span class="w"> </span><span class="n">of</span>
<span class="n">the</span><span class="w"> </span><span class="n">simplest</span><span class="w"> </span><span class="n">to</span><span class="w"> </span><span class="n">write</span><span class="p">.</span><span class="w"> </span><span class="n">We</span><span class="w"> </span><span class="n">look</span><span class="w"> </span><span class="n">at</span><span class="w"> </span><span class="n">each</span><span class="w"> </span><span class="n">character</span><span class="w"> </span><span class="n">and</span><span class="w"> </span><span class="n">change</span><span class="w"> </span><span class="n">state</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="n">begins</span><span class="w"> </span><span class="n">or</span><span class="w"> </span><span class="n">ends</span>
<span class="n">a</span><span class="w"> </span><span class="n">word</span><span class="p">.</span>
<span class="w"> </span><span class="o"><<</span><span class="n">Scan</span><span class="w"> </span><span class="n">file</span><span class="o">>>=</span>
<span class="w"> </span><span class="k">while</span><span class="w"> </span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="o"><<</span><span class="n">Fill</span><span class="w"> </span><span class="n">buffer</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="n">is</span><span class="w"> </span><span class="n">empty</span><span class="p">;</span><span class="w"> </span><span class="k">break</span><span class="w"> </span><span class="n">at</span><span class="w"> </span><span class="n">end</span><span class="w"> </span><span class="n">of</span><span class="w"> </span><span class="n">file</span><span class="o">>></span>
<span class="w"> </span><span class="n">c</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">*</span><span class="n">ptr</span><span class="o">++</span><span class="p">;</span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">c</span><span class="w"> </span><span class="o">></span><span class="w"> </span><span class="sc">' '</span><span class="w"> </span><span class="o">&&</span><span class="w"> </span><span class="n">c</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="mo">0177</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="cm">/* visible ASCII codes */</span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="o">!</span><span class="n">in_word</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="n">word_count</span><span class="o">++</span><span class="p">;</span>
<span class="w"> </span><span class="n">in_word</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="k">continue</span><span class="p">;</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">c</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="sc">'\n'</span><span class="p">)</span><span class="w"> </span><span class="n">line_count</span><span class="o">++</span><span class="p">;</span>
<span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">c</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="sc">' '</span><span class="w"> </span><span class="o">&&</span><span class="w"> </span><span class="n">c</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="sc">'\t'</span><span class="p">)</span><span class="w"> </span><span class="k">continue</span><span class="p">;</span>
<span class="w"> </span><span class="n">in_word</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
<span class="w"> </span><span class="cm">/* c is newline, space, or tab */</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="err">@</span>
</pre></div>
<p>The macros stand for any chunk of code or other macros, and are more general than top-down or bottom-up "chunking", or than subsectioning. Donald Knuth said that when he realized this, he began to think of a program as a <i>web</i> of various parts.<sup id="cite_ref-TCJ_LP_1-2" class="reference"><a href="#cite_note-TCJ_LP-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="Order_of_human_logic,_not_that_of_the_compiler">Order of human logic, not that of the compiler</h3></div>
<p>In a noweb literate program besides the free order of their exposition, the chunks behind macros, once introduced with <code><<...>>=</code>, can be grown later in any place in the file by simply writing <code><<name of the chunk>>=</code> and adding more content to it, as the following snippet illustrates (<code>+</code> is added by the document formatter for readability, and is not in the code).<sup id="cite_ref-noweb-wc_14-3" class="reference"><a href="#cite_note-noweb-wc-14"><span class="cite-bracket">[</span>14<span class="cite-bracket">]</span></a></sup>
</p>
<style data-mw-deduplicate="TemplateStyles:r1195917819">
/* start https://en.wikipedia.org/ */
.mw-parser-output .pre-borderless{border:none}
/* end https://en.wikipedia.org/ */
</style><pre class="pre">The grand totals must be initialized to zero at the beginning of the program.
If we made these variables local to main, we would have to do this initialization
explicitly; however, C globals are automatically zeroed. (Or rather,``statically
zeroed.'' (Get it?)
<<Global variables>>+=
<code class="mw-highlight mw-highlight-lang-c mw-content-ltr" style="background:none; border:none; color:inherit; padding: 0px 0px;" dir="ltr"><span class="kt">long</span><span class="w"> </span><span class="n">tot_word_count</span><span class="p">,</span><span class="w"> </span><span class="n">tot_line_count</span><span class="p">,</span></code>
tot_char_count;
<code class="mw-highlight mw-highlight-lang-c mw-content-ltr" style="background:none; border:none; color:inherit; padding: 0px 0px;" dir="ltr"><span class="cm">/* total number of words, lines, chars */</span></code>
@</pre>
<div class="mw-heading mw-heading3"><h3 id="Record_of_the_train_of_thought">Record of the train of thought</h3></div>
<p>The documentation for a literate program is produced as part of writing the program. Instead of comments provided as side notes to source code a literate program contains the explanation of concepts on each level, with lower level concepts deferred to their appropriate place, which allows better communication of thought. The snippets of the literate <code>wc</code> above show how an explanation of the program and its source code are interwoven. Such exposition of ideas creates the flow of thought that is like a literary work. Knuth wrote a "novel" which explains the code of the <a href="Interactive_fiction" title="Interactive fiction">interactive fiction</a> game <a href="Colossal_Cave_Adventure" title="Colossal Cave Adventure">Colossal Cave Adventure</a>.<sup id="cite_ref-15" class="reference"><a href="#cite_note-15"><span class="cite-bracket">[</span>15<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="Remarkable_examples">Remarkable examples</h3></div>
<ul><li><a href="Axiom_(computer_algebra_system)" title="Axiom (computer algebra system)">Axiom</a>, which is evolved from scratchpad, a computer algebra system developed by IBM. It is now being developed by Tim Daly, one of the developers of scratchpad, Axiom is totally written as a literate program.</li></ul>
<div class="mw-heading mw-heading2"><h2 id="Literate_programming_practices">Literate programming practices</h2></div>
<p>The first published literate programming environment was <a href="Web_(programming_system)" title="Web (programming system)">WEB</a>, introduced by Knuth in 1981 for his <a href="TeX" title="TeX">TeX</a> typesetting system; it uses <a href="Pascal_(programming_language)" title="Pascal (programming language)">Pascal</a> as its underlying programming language and TeX for typesetting of the documentation. The complete commented TeX source code was published in Knuth's <i>TeX: The program</i>, volume B of his 5-volume <i><a href="Computers_and_Typesetting" title="Computers and Typesetting">Computers and Typesetting</a></i>. Knuth had privately used a literate programming system called DOC as early as 1979. He was inspired by the ideas of <a href="Pierre-Arnoul_de_Marneffe" title="Pierre-Arnoul de Marneffe">Pierre-Arnoul de Marneffe</a>.<sup id="cite_ref-16" class="reference"><a href="#cite_note-16"><span class="cite-bracket">[</span>16<span class="cite-bracket">]</span></a></sup> The free <a href="CWEB" class="mw-redirect" title="CWEB">CWEB</a>, written by Knuth and Silvio Levy, is WEB adapted for <a href="C_(programming_language)" title="C (programming language)">C</a> and <a href="C%2B%2B" title="C++">C++</a>, runs on most operating systems, and can produce TeX and <a href="Portable_Document_Format" class="mw-redirect" title="Portable Document Format">PDF</a> documentation.
</p><p>There are various other implementations of the literate programming concept as given below. Many of the newer among these do not have macros and hence do not comply with the <a href="#Order_of_human_logic,_not_that_of_the_compiler">order of human logic</a> principle, which makes them perhaps "semi-literate" tools. These, however, allow cellular execution of code which makes them more along the lines of <a href="Exploratory_programming" title="Exploratory programming">exploratory programming</a> tools.
</p>
<table class="wikitable sortable" style="text-align: center;">
<tbody><tr>
<th>Name
</th>
<th>Supported languages
</th>
<th>Written in
</th>
<th>Markup language
</th>
<th>Macros & custom order
</th>
<th>Cellular execution
</th>
<th>Comments
</th></tr>
<tr>
<td><a href="Web_(programming_system)" title="Web (programming system)">WEB</a></td>
<td><a href="Pascal_(programming_language)" title="Pascal (programming language)">Pascal</a></td>
<td><a href="Pascal_(programming_language)" title="Pascal (programming language)">Pascal</a></td>
<td><a href="TeX" title="TeX">TeX</a>
</td>
<td style="background:#9EFF9E;color:black;vertical-align:middle;text-align:center;" class="table-yes">Yes
</td>
<td style="background:#FFC7C7;color:black;vertical-align:middle;text-align:center;" class="table-no">No</td>
<td>The first published literate programming environment.
</td></tr>
<tr>
<td><a href="CWEB" class="mw-redirect" title="CWEB">CWEB</a></td>
<td><a href="C%2B%2B" title="C++">C++</a> and <a href="C_(programming_language)" title="C (programming language)">C</a></td>
<td><a href="C_(programming_language)" title="C (programming language)">C</a></td>
<td><a href="TeX" title="TeX">TeX</a>
</td>
<td style="background:#9EFF9E;color:black;vertical-align:middle;text-align:center;" class="table-yes">Yes
</td>
<td style="background:#FFC7C7;color:black;vertical-align:middle;text-align:center;" class="table-no">No</td>
<td>Is <a href="Web_(programming_system)" title="Web (programming system)">WEB</a> adapted for <a href="C_(programming_language)" title="C (programming language)">C</a> and <a href="C%2B%2B" title="C++">C++</a>.
</td></tr>
<tr>
<td><a href="Noweb" title="Noweb">NoWEB</a></td>
<td style="background: #FFD; color:black; vertical-align: middle; text-align: center;" class="any table-any">Any</td>
<td><a href="C_(programming_language)" title="C (programming language)">C</a>, <a href="AWK" title="AWK">AWK</a>, and <a href="Icon_(programming_language)" title="Icon (programming language)">Icon</a></td>
<td><a href="LaTeX" title="LaTeX">LaTeX</a>, <a href="TeX" title="TeX">TeX</a>, <a href="HTML" title="HTML">HTML</a> and <a href="Troff" title="Troff">troff</a>
</td>
<td style="background:#9EFF9E;color:black;vertical-align:middle;text-align:center;" class="table-yes">Yes
</td>
<td style="background:#FFC7C7;color:black;vertical-align:middle;text-align:center;" class="table-no">No</td>
<td>It is well known for its simplicity and for allowing text formatting in HTML rather than going through the TeX system.
</td></tr>
<tr>
<td><a href="Emacs" title="Emacs">Emacs</a> <a href="Org-mode" title="Org-mode">org-mode</a></td>
<td style="background: #FFD; color:black; vertical-align: middle; text-align: center;" class="any table-any">Any</td>
<td><a href="Emacs_Lisp" title="Emacs Lisp">Emacs Lisp</a></td>
<td><a href="Plain_text" title="Plain text">Plain text</a>
</td>
<td>
</td>
<td></td>
<td>Requires Babel,<sup id="cite_ref-17" class="reference"><a href="#cite_note-17"><span class="cite-bracket">[</span>17<span class="cite-bracket">]</span></a></sup> which allows embedding blocks of source code from multiple programming languages<sup id="cite_ref-18" class="reference"><a href="#cite_note-18"><span class="cite-bracket">[</span>18<span class="cite-bracket">]</span></a></sup> within one text document. Blocks of code can share data with each other, display images inline, or be parsed into pure source code using the <a href="Noweb" title="Noweb">noweb</a> reference <a href="Syntax_(programming_languages)" title="Syntax (programming languages)">syntax</a>.<sup id="cite_ref-19" class="reference"><a href="#cite_note-19"><span class="cite-bracket">[</span>19<span class="cite-bracket">]</span></a></sup>
</td></tr>
<tr>
<td><a href="CoffeeScript" title="CoffeeScript">CoffeeScript</a></td>
<td><a href="CoffeeScript" title="CoffeeScript">CoffeeScript</a></td>
<td><a href="CoffeeScript" title="CoffeeScript">CoffeeScript</a>, <a href="JavaScript" title="JavaScript">JavaScript</a></td>
<td><a href="Markdown" title="Markdown">Markdown</a>
</td>
<td>
</td>
<td></td>
<td><a href="CoffeeScript" title="CoffeeScript">CoffeeScript</a> supports a "literate" mode, which enables programs to be compiled from a source document written in <a href="Markdown" title="Markdown">Markdown</a> with indented blocks of code.<sup id="cite_ref-20" class="reference"><a href="#cite_note-20"><span class="cite-bracket">[</span>20<span class="cite-bracket">]</span></a></sup>
</td></tr>
<tr>
<td><a href="Maple_(software)" title="Maple (software)">Maple worksheets</a></td>
<td><a href="Maple_(software)" title="Maple (software)">Maple (software)</a></td>
<td></td>
<td><a href="XML" title="XML">XML</a>
</td>
<td>
</td>
<td></td>
<td><a href="Maple_(software)" title="Maple (software)">Maple worksheets</a> are a platform-agnostic literate programming environment that combines text and graphics with live code for symbolic computation.<style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}
/* end https://en.wikipedia.org/ */
</style><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://www.maplesoft.com/support/help/Maple/view.aspx?path=Worksheet">"Maple Worksheets"</a>. <i>MapleSoft.com</i><span class="reference-accessdate">. Retrieved <span class="nowrap">May 30,</span> 2020</span>.</cite>
</td></tr>
<tr>
<td><a href="Wolfram_Mathematica" class="mw-redirect" title="Wolfram Mathematica">Wolfram Notebooks</a></td>
<td><a href="Wolfram_Language" title="Wolfram Language">Wolfram Language</a></td>
<td></td>
<td><a href="Wolfram_Language" title="Wolfram Language">Wolfram Language</a>
</td>
<td>
</td>
<td></td>
<td><a href="Wolfram_Mathematica" class="mw-redirect" title="Wolfram Mathematica">Wolfram notebooks</a> are a platform-agnostic literate programming method that combines text and graphics with live code.<sup id="cite_ref-21" class="reference"><a href="#cite_note-21"><span class="cite-bracket">[</span>21<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-22" class="reference"><a href="#cite_note-22"><span class="cite-bracket">[</span>22<span class="cite-bracket">]</span></a></sup>
</td></tr>
<tr>
<td><a href="Project_Jupyter#Jupyter_Notebook" title="Project Jupyter">Jupyter Notebook</a>, formerly <a href="IPython" title="IPython">IPython Notebook</a></td>
<td><a href="Python_(programming_language)" title="Python (programming language)">Python</a> and any with a Jupyter Kernel</td>
<td></td>
<td><a href="JSON" title="JSON">JSON</a> format Specification for <a rel="nofollow" class="external text" href="https://ipython.org/ipython-doc/3/notebook/nbformat.html">ipynb</a>
</td>
<td style="background:#FFC7C7;color:black;vertical-align:middle;text-align:center;" class="table-no">No
</td>
<td style="background:#9EFF9E;color:black;vertical-align:middle;text-align:center;" class="table-yes">Yes</td>
<td>Works in the format of notebooks, which combine headings, text (including LaTeX), plots, etc. with the written code.
</td></tr>
<tr>
<td><a rel="nofollow" class="external text" href="https://nbdev.fast.ai/">nbdev</a>
</td>
<td><a href="Python_(programming_language)" title="Python (programming language)">Python</a> and <a href="Project_Jupyter" title="Project Jupyter">Jupyter Notebook</a>
</td>
<td>
</td>
<td><code>nbdev</code> is a library that allows developing a python library in Jupyter Notebooks, putting all code, tests and documentation in one place.
</td>
<td>
</td>
<td>
</td></tr>
<tr>
<td><a href="Julia_(programming_language)" title="Julia (programming language)">Julia (programming language)</a></td>
<td></td>
<td></td>
<td>
</td>
<td><a rel="nofollow" class="external text" href="https://plutojl.org">Pluto.jl</a> is a <a href="Reactive_programming" title="Reactive programming">reactive</a> notebook environment allowing custom order. But web-like macros aren't supported.
</td>
<td style="background:#9EFF9E;color:black;vertical-align:middle;text-align:center;" class="table-yes">Yes</td>
<td>Supports the iJulia mode of development which was inspired by iPython.
</td></tr>
<tr>
<td><a href="Agda_(programming_language)" title="Agda (programming language)">Agda (programming language)</a></td>
<td></td>
<td></td>
<td>
</td>
<td>
</td>
<td></td>
<td>Supports a limited form of literate programming out of the box.<sup id="cite_ref-23" class="reference"><a href="#cite_note-23"><span class="cite-bracket">[</span>23<span class="cite-bracket">]</span></a></sup>
</td></tr>
<tr>
<td><a href="Sweave" title="Sweave">Sweave</a></td>
<td><a href="R_(programming_language)" title="R (programming language)">R</a></td>
<td></td>
<td><a href="PDF" title="PDF">PDF</a>
</td>
<td>
</td>
<td></td>
<td><sup id="cite_ref-Leisch2002_24-0" class="reference"><a href="#cite_note-Leisch2002-24"><span class="cite-bracket">[</span>24<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-Pineda-Krch2011_25-0" class="reference"><a href="#cite_note-Pineda-Krch2011-25"><span class="cite-bracket">[</span>25<span class="cite-bracket">]</span></a></sup>
</td></tr>
<tr>
<td><a href="Knitr" title="Knitr">Knitr</a></td>
<td><a href="R_(programming_language)" title="R (programming language)">R</a></td>
<td></td>
<td><a href="LaTeX" title="LaTeX">LaTeX</a>, <a href="PDF" title="PDF">PDF</a>, <a href="LyX" title="LyX">LyX</a>, <a href="HTML" title="HTML">HTML</a>, <a href="Markdown" title="Markdown">Markdown</a>, <a href="AsciiDoc" title="AsciiDoc">AsciiDoc</a>, and <a href="ReStructuredText" title="ReStructuredText">reStructuredText</a>
</td>
<td>
</td>
<td></td>
<td><sup id="cite_ref-26" class="reference"><a href="#cite_note-26"><span class="cite-bracket">[</span>26<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-27" class="reference"><a href="#cite_note-27"><span class="cite-bracket">[</span>27<span class="cite-bracket">]</span></a></sup>
</td></tr>
<tr>
<td><a rel="nofollow" class="external text" href="https://github.com/zyedidia/Literate">Literate</a></td>
<td style="background: #FFD; color:black; vertical-align: middle; text-align: center;" class="any table-any">Any</td>
<td><a href="D_(programming_language)" title="D (programming language)">D</a></td>
<td><a href="Markdown" title="Markdown">Markdown</a>
</td>
<td style="background:#9EFF9E;color:black;vertical-align:middle;text-align:center;" class="table-yes">Yes
</td>
<td style="background:#FFC7C7;color:black;vertical-align:middle;text-align:center;" class="table-no">No</td>
<td>Supports TeX equations. Compatible with Vim.
</td></tr></tbody></table>
<p>Other useful tools include:
</p>
<div><ul><li>The <a href="Leo_(text_editor)" title="Leo (text editor)">Leo text editor</a> is an <i>outlining</i> editor which supports optional noweb and CWEB markup. The author of Leo mixes two different approaches: first, Leo is an outlining editor, which helps with management of large texts; second, Leo incorporates some of the ideas of literate programming, which in its pure form (i.e., the way it is used by Knuth Web tool or tools like "noweb") is possible only with some degree of inventiveness and the use of the editor in a way not exactly envisioned by its author (in modified @root nodes). However, this and other extensions (@file nodes) make outline programming and text management successful and easy and in some ways similar to literate programming.<sup id="cite_ref-28" class="reference"><a href="#cite_note-28"><span class="cite-bracket">[</span>28<span class="cite-bracket">]</span></a></sup></li><li>The <a href="Haskell" title="Haskell">Haskell</a> language has native support for semi-literate programming. The compiler–interpreter supports two file name extensions: <code>.hs</code> and <code>.lhs</code>; the latter stands for literate Haskell.
<p>The literate scripts can be full LaTeX source text, at the same time it can be compiled, with no changes, because the interpreter only compiles the text in a code environment, for example:
</p>
<div class="mw-highlight mw-highlight-lang-lhs mw-content-ltr" dir="ltr"><pre><span class="c">% here text describing the function:</span>
<span class="k">\begin</span><span class="nb">{</span>code<span class="nb">}</span>
<span class="nf">fact</span><span class="w"> </span><span class="mi">0</span><span class="w"> </span><span class="ow">=</span><span class="w"> </span><span class="mi">1</span>
<span class="nf">fact</span><span class="w"> </span><span class="p">(</span><span class="n">n</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="ow">=</span><span class="w"> </span><span class="p">(</span><span class="n">n</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">fact</span><span class="w"> </span><span class="n">n</span>
<span class="k">\end</span><span class="nb">{</span>code<span class="nb">}</span>
here more text
</pre></div>
<p>The code can be also marked in the Richard Bird style, starting each line with a greater than symbol and a space, preceding and ending the piece of code with blank lines.
</p><p>The LaTeX <code>listings</code> package provides a <code>lstlisting</code> environment which can be used to embellish the source code. It can be used to define a <code>code</code> environment to use within Haskell to print the symbols in the following manner:
</p>
<div class="mw-highlight mw-highlight-lang-lhs mw-content-ltr" dir="ltr"><pre><span class="k">\newenvironment</span><span class="nb">{</span>code<span class="nb">}{</span><span class="k">\lstlistings</span><span class="na">[language=Haskell]</span><span class="nb">}{</span><span class="k">\endlstlistings</span><span class="nb">}</span>
<span class="k">\begin</span><span class="nb">{</span>code<span class="nb">}</span>
<span class="nf">comp</span><span class="w"> </span><span class="ow">::</span><span class="w"> </span><span class="p">(</span><span class="n">beta</span><span class="w"> </span><span class="ow">-></span><span class="w"> </span><span class="n">gamma</span><span class="p">)</span><span class="w"> </span><span class="ow">-></span><span class="w"> </span><span class="p">(</span><span class="n">alpha</span><span class="w"> </span><span class="ow">-></span><span class="w"> </span><span class="n">beta</span><span class="p">)</span><span class="w"> </span><span class="ow">-></span><span class="w"> </span><span class="p">(</span><span class="n">alpha</span><span class="w"> </span><span class="ow">-></span><span class="w"> </span><span class="n">gamma</span><span class="p">)</span>
<span class="p">(</span><span class="n">g</span><span class="w"> </span><span class="p">`</span><span class="n">comp</span><span class="p">`</span><span class="w"> </span><span class="n">f</span><span class="p">)</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="ow">=</span><span class="w"> </span><span class="n">g</span><span class="p">(</span><span class="n">f</span><span class="w"> </span><span class="n">x</span><span class="p">)</span>
<span class="k">\end</span><span class="nb">{</span>code<span class="nb">}</span>
</pre></div>
<p>which can be configured to yield:
</p>
<style data-mw-deduplicate="TemplateStyles:r996643573">
/* start https://en.wikipedia.org/ */
.mw-parser-output .block-indent{padding-left:3em;padding-right:0;overflow:hidden}
/* end https://en.wikipedia.org/ */
</style><div class="block-indent"><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\begin{aligned}&comp::(\beta \to \gamma )\to (\alpha \to \beta )\to (\alpha \to \gamma )\\&(g\operatorname {comp} f)x=g(fx)\end{aligned}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mtable columnalign="right left right left right left right left right left right left" rowspacing="3pt" columnspacing="0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em" displaystyle="true">
<mtr>
<mtd></mtd>
<mtd>
<mi>c</mi>
<mi>o</mi>
<mi>m</mi>
<mi>p</mi>
<mo>::</mo>
<mo stretchy="false">(</mo>
<mi>β<!-- β --></mi>
<mo stretchy="false">→<!-- → --></mo>
<mi>γ<!-- γ --></mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">→<!-- → --></mo>
<mo stretchy="false">(</mo>
<mi>α<!-- α --></mi>
<mo stretchy="false">→<!-- → --></mo>
<mi>β<!-- β --></mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">→<!-- → --></mo>
<mo stretchy="false">(</mo>
<mi>α<!-- α --></mi>
<mo stretchy="false">→<!-- → --></mo>
<mi>γ<!-- γ --></mi>
<mo stretchy="false">)</mo>
</mtd>
</mtr>
<mtr>
<mtd></mtd>
<mtd>
<mi></mi>
<mo stretchy="false">(</mo>
<mi>g</mi>
<mi>comp</mi>
<mo><!-- --></mo>
<mi>f</mi>
<mo stretchy="false">)</mo>
<mi>x</mi>
<mo>=</mo>
<mi>g</mi>
<mo stretchy="false">(</mo>
<mi>f</mi>
<mi>x</mi>
<mo stretchy="false">)</mo>
</mtd>
</mtr>
</mtable>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\begin{aligned}&comp::(\beta \to \gamma )\to (\alpha \to \beta )\to (\alpha \to \gamma )\\&(g\operatorname {comp} f)x=g(fx)\end{aligned}}}</annotation>
</semantics>
</math></span><img src="./3f60d5abf56796c7510d7b3c6f8aa72796d9379d.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.505ex; width:40.342ex; height:6.176ex;" alt="{\displaystyle {\begin{aligned}&comp::(\beta \to \gamma )\to (\alpha \to \beta )\to (\alpha \to \gamma )\\&(g\operatorname {comp} f)x=g(fx)\end{aligned}}}" loading="lazy"></span></div>
Although the package provides no means to organize chunks of code, LaTeX source code can be divided in different files.<sup id="cite_ref-29" class="reference"><a href="#cite_note-29"><span class="cite-bracket">[</span>29<span class="cite-bracket">]</span></a></sup></li><li>The Web 68 Literate Programming system used <a href="ALGOL_68" title="ALGOL 68">ALGOL 68</a> as the underlying language, although there was nothing in the pre-processor 'tang' to force such use.<sup id="cite_ref-30" class="reference"><a href="#cite_note-30"><span class="cite-bracket">[</span>30<span class="cite-bracket">]</span></a></sup></li><li>The customization mechanism of the <a href="Text_Encoding_Initiative" title="Text Encoding Initiative">Text Encoding Initiative</a> (TEI) which enables constraining, modifying, or extending the TEI scheme, enables mixing prose documentation with fragments of schema specification in the <a href="Text_Encoding_Initiative#ODD" title="Text Encoding Initiative">One Document Does-it-all</a> format. From this prose documentation, schemas, and processing model pipelines can be generated and Knuth's Literate Programming paradigm is cited as the inspiration for this way of working.<sup id="cite_ref-31" class="reference"><a href="#cite_note-31"><span class="cite-bracket">[</span>31<span class="cite-bracket">]</span></a></sup></li></ul></div>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Documentation_generator" title="Documentation generator">Documentation generator</a> – the inverse on literate programming where documentation is embedded in and generated from source code</li>
<li><a href="Notebook_interface" title="Notebook interface">Notebook interface</a> – virtual notebook environment used for literate programming</li>
<li><a href="Sweave" title="Sweave">Sweave</a> and <a href="Knitr" title="Knitr">Knitr</a> – examples of use of the "noweb"-like Literate Programming tool inside the R language for creation of dynamic statistical reports</li>
<li><a href="Self-documenting_code" title="Self-documenting code">Self-documenting code</a> – source code that can be easily understood without documentation</li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */
.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}
/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap mw-references-columns"><ol class="references">
<li id="cite_note-TCJ_LP-1"><span class="mw-cite-backlink">^ <a href="#cite_ref-TCJ_LP_1-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-TCJ_LP_1-1"><sup><i><b>b</b></i></sup></a> <a href="#cite_ref-TCJ_LP_1-2"><sup><i><b>c</b></i></sup></a></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1041539562">
/* start https://en.wikipedia.org/ */
.mw-parser-output .citation{word-wrap:break-word}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}
/* end https://en.wikipedia.org/ */
</style><span class="citation wikicite" id="endnote_TCJ_LPv"><a href="#ref_TCJ_LPv"><b><sup>v</sup></b></a></span> <span class="citation wikicite" id="endnote_TCJ_LPw"><a href="#ref_TCJ_LPw"><b><sup>w</sup></b></a></span> <span class="citation wikicite" id="endnote_TCJ_LPx"><a href="#ref_TCJ_LPx"><b><sup>x</sup></b></a></span> <span class="citation wikicite" id="endnote_TCJ_LPy"><a href="#ref_TCJ_LPy"><b><sup>y</sup></b></a></span> <span class="citation wikicite" id="endnote_TCJ_LPz"><a href="#ref_TCJ_LPz"><b><sup>z</sup></b></a></span> <cite id="CITEREFKnuth1984" class="citation journal cs1"><a href="Donald_Knuth" title="Donald Knuth">Knuth, Donald E.</a> (1984). <a rel="nofollow" class="external text" href="http://www.literateprogramming.com/knuthweb.pdf">"Literate Programming"</a> <span class="cs1-format">(PDF)</span>. <i><a href="The_Computer_Journal" title="The Computer Journal">The Computer Journal</a></i>. <b>27</b> (2). <a href="British_Computer_Society" title="British Computer Society">British Computer Society</a>: <span class="nowrap">97–</span>111. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1093%2Fcomjnl%2F27.2.97">10.1093/comjnl/27.2.97</a></span><span class="reference-accessdate">. Retrieved <span class="nowrap">January 4,</span> 2009</span>.</cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite id="CITEREFSchulte2012" class="citation journal cs1">Schulte, Eric (2012). <a rel="nofollow" class="external text" href="https://www.jstatsoft.org/article/view/v046i03/v46i03.pdf">"A Multi-Language Computing Environment for Literate Programming and Reproducible Research"</a> <span class="cs1-format">(PDF)</span>. <i>Journal of Statistical Software</i>. <b>46</b> (3). <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.18637%2Fjss.v046.i03">10.18637/jss.v046.i03</a></span>. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20141109113411/https://www.jstatsoft.org/article/view/v046i03/v46i03.pdf">Archived</a> <span class="cs1-format">(PDF)</span> from the original on November 9, 2014<span class="reference-accessdate">. Retrieved <span class="nowrap">May 30,</span> 2020</span>.</cite></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><cite id="CITEREFKery2018" class="citation conference cs1">Kery, Mary Beth (April 2018). "The Story in the Notebook: Exploratory Data Science using a Literate Programming Tool". <i>CHI '18: Proceedings of the 2018 CHI Conference on Human Factors in Computing Systems</i>. <a href="Association_for_Computing_Machinery" title="Association for Computing Machinery">Association for Computing Machinery</a>. pp. <span class="nowrap">1–</span>11. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F3173574.3173748">10.1145/3173574.3173748</a>.</cite></span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1244412712">
/* start https://en.wikipedia.org/ */
.mw-parser-output .templatequote{overflow:hidden;margin:1em 0;padding:0 32px}.mw-parser-output .templatequotecite{line-height:1.5em;text-align:left;margin-top:0}@media(min-width:500px){.mw-parser-output .templatequotecite{padding-left:1.6em}}
/* end https://en.wikipedia.org/ */
</style><blockquote class="templatequote"><p>I had the feeling that top-down and bottom-up were opposing methodologies: one more suitable for program exposition and the other more suitable for program creation. But after gaining experience with WEB, I have come to realize that there is no need to choose once and for all between top-down and bottom-up, because a program is best thought of as a web instead of a tree. A hierarchical structure is present, but the most important thing about a program is its structural relationships. A complex piece of software consists of simple parts and simple relations between those parts; the programmer's task is to state those parts and those relationships, in whatever order is best for human comprehension not in some rigidly determined order like top-down or bottom-up. </p></blockquote><div class="templatequotecite"><p style="display: inline; padding-left: 2.3em;">— <a href="Donald_Knuth" title="Donald Knuth">Donald E. Knuth</a>, <i>Literate Programming</i><sup class="citation nobold" id="ref_TCJ_LPv"><a href="#endnote_TCJ_LPv">[1]</a></sup></p></div></span>
</li>
<li id="cite_note-ObliqueScottReference-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-ObliqueScottReference_5-0">^</a></b></span> <span class="reference-text">If one remembers that the first version of the tool was called WEB, the amusing literary reference hidden by Knuth in these names becomes obvious: "Oh, what a tangled web we weave when first we practise to deceive" — <a href="Sir_Walter_Scott" class="mw-redirect" title="Sir Walter Scott">Sir Walter Scott</a>, in Canto VI, Stanza 17 of <i><a href="Marmion_(poem)" title="Marmion (poem)">Marmion</a></i> (1808) an epic poem about the <a href="Battle_of_Flodden" title="Battle of Flodden">Battle of Flodden</a> in 1513. – the actual citation appeared as an epigraph in a May 1986 article by Jon Bentley and Donald Knuth in one of the classical "Programming Pearls" columns in <i>Communications of the ACM</i>, vol. 29, no. 5, p. 365.</span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-6">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://www.literateprogramming.com/knuthweb.pdf">"Literate Programming"</a> <span class="cs1-format">(PDF)</span>. <i>Archive.ComputerHistory.org</i><span class="reference-accessdate">. Retrieved <span class="nowrap">June 3,</span> 2019</span>.</cite></span>
</li>
<li id="cite_note-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-7">^</a></b></span> <span class="reference-text"><blockquote class="templatequote"><p>WEB's macros are allowed to have at most one parameter. Again, I did this in the interests of simplicity, because I noticed that most applications of multiple parameters could in fact be reduced to the one-parameter case. For example, suppose that you want to define something like [example elided] .... In other words, the name of one macro can usefully be a parameter to another macro.
</p></blockquote><div class="templatequotecite"><p style="display: inline; padding-left: 2.3em;">— <a href="Donald_Knuth" title="Donald Knuth">Donald E. Knuth</a>, <i>Literate Programming</i><sup class="citation nobold" id="ref_TCJ_LPw"><a href="#endnote_TCJ_LPw">[1]</a></sup></p></div></span>
</li>
<li id="cite_note-Knuth-8"><span class="mw-cite-backlink">^ <a href="#cite_ref-Knuth_8-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-Knuth_8-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><cite id="CITEREFKnuthBinstock2008" class="citation web cs1"><a href="Donald_Knuth" title="Donald Knuth">Knuth, Donald E.</a>; Binstock, Andrew (April 25, 2008). <a rel="nofollow" class="external text" href="https://www.informit.com/articles/article.aspx?p=1193856">"Interview with Donald Knuth"</a><span class="reference-accessdate">. Retrieved <span class="nowrap">January 4,</span> 2009</span>. <q>Yet to me, literate programming is certainly the most important thing that came out of the <a href="TeX" title="TeX">TeX</a> project. Not only has it enabled me to write and maintain programs faster and more reliably than ever before, and been one of my greatest sources of joy since the 1980s, it has actually been indispensable at times. Some of my major programs, such as the MMIX meta-simulator, could not have been written with any other methodology that I've ever heard of. The complexity was simply too daunting for my limited brain to handle; without literate programming, the whole enterprise would have flopped miserably. ... Literate programming is what you need to rise above the ordinary level of achievement.</q></cite></span>
</li>
<li id="cite_note-9"><span class="mw-cite-backlink"><b><a href="#cite_ref-9">^</a></b></span> <span class="reference-text"><blockquote class="templatequote"><p>Another surprising thing that I learned while using WEB was that traditional programming languages had been causing me to write inferior programs, although I hadn't realized what I was doing. My original idea was that WEB would be merely a tool for documentation, but I actually found that my WEB programs were better than the programs I had been writing in other languages.
</p></blockquote><div class="templatequotecite"><p style="display: inline; padding-left: 2.3em;">— <a href="Donald_Knuth" title="Donald Knuth">Donald E. Knuth</a>, <i>Literate Programming</i><sup class="citation nobold" id="ref_TCJ_LPx"><a href="#endnote_TCJ_LPx">[1]</a></sup></p></div></span>
</li>
<li id="cite_note-10"><span class="mw-cite-backlink"><b><a href="#cite_ref-10">^</a></b></span> <span class="reference-text"><blockquote class="templatequote"><p>Thus the WEB language allows a person to express programs in a <i>"stream of consciousness" order</i>. TANGLE is able to scramble everything up into the arrangement that a PASCAL compiler demands. This feature of WEB is perhaps its greatest asset; it makes a WEB-written program much more readable than the same program written purely in PASCAL, even if the latter program is well commented. And the fact that there's no need to be hung up on the question of top-down versus bottom-up, since a programmer can now <i>view a large program as a web, to be explored in a <b>psychologically correct order</b> is perhaps the greatest lesson</i> I have learned from my recent experiences.
</p></blockquote><div class="templatequotecite"><p style="display: inline; padding-left: 2.3em;">— <a href="Donald_Knuth" title="Donald Knuth">Donald E. Knuth</a>, <i>Literate Programming</i><sup class="citation nobold" id="ref_TCJ_LPy"><a href="#endnote_TCJ_LPy">[1]</a></sup></p></div></span>
</li>
<li id="cite_note-11"><span class="mw-cite-backlink"><b><a href="#cite_ref-11">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://archive.computerhistory.org/resources/text/Oral_History/Knuth_Don_1/Knuth_Don.oral_history.2007.102658053_all.pdf">""Oral History of Donald Knuth"- an Interview with Ed Feigenbaum"</a> <span class="cs1-format">(PDF)</span>. <i>Archive.ComputerHistory.org</i><span class="reference-accessdate">. Retrieved <span class="nowrap">December 7,</span> 2018</span>.</cite></span>
</li>
<li id="cite_note-MJD2000-12"><span class="mw-cite-backlink">^ <a href="#cite_ref-MJD2000_12-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-MJD2000_12-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><cite id="CITEREFDominus2000" class="citation web cs1"><a href="Mark_Jason_Dominus" class="mw-redirect" title="Mark Jason Dominus">Dominus, Mark-Jason</a> (March 20, 2000). <a rel="nofollow" class="external text" href="https://www.perl.com/pub/tchrist/litprog.html/">"POD is not Literate Programming"</a>. <i>Perl.com</i>. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20090102151452/http://www.perl.com/pub/a/tchrist/litprog.html">Archived</a> from the original on January 2, 2009.</cite></span>
</li>
<li id="cite_note-13"><span class="mw-cite-backlink"><b><a href="#cite_ref-13">^</a></b></span> <span class="reference-text"><blockquote class="templatequote"><p>I chose the name WEB partly because it was one of the few three-letter words of English that hadn't already been applied to computers. But as time went on, I've become extremely pleased with the name, because I think that a complex piece of software is, indeed, best regarded as a web that has been delicately pieced together from simple materials. We understand a complicated system by understanding its simple parts, and by understanding the simple relations between those parts and their immediate neighbors. If we express a program as a web of ideas, we can emphasize its structural properties in a natural and satisfying way.
</p></blockquote><div class="templatequotecite"><p style="display: inline; padding-left: 2.3em;">— <a href="Donald_Knuth" title="Donald Knuth">Donald E. Knuth</a>, <i>Literate Programming</i><sup class="citation nobold" id="ref_TCJ_LPz"><a href="#endnote_TCJ_LPz">[1]</a></sup></p></div></span>
</li>
<li id="cite_note-noweb-wc-14"><span class="mw-cite-backlink">^ <a href="#cite_ref-noweb-wc_14-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-noweb-wc_14-1"><sup><i><b>b</b></i></sup></a> <a href="#cite_ref-noweb-wc_14-2"><sup><i><b>c</b></i></sup></a> <a href="#cite_ref-noweb-wc_14-3"><sup><i><b>d</b></i></sup></a></span> <span class="reference-text"><cite id="CITEREFRamsey2008" class="citation web cs1">Ramsey, Norman (May 13, 2008). <a rel="nofollow" class="external text" href="https://www.cs.tufts.edu/~nr/noweb/examples/wc.html">"An Example of noweb"</a><span class="reference-accessdate">. Retrieved <span class="nowrap">January 4,</span> 2009</span>.</cite></span>
</li>
<li id="cite_note-15"><span class="mw-cite-backlink"><b><a href="#cite_ref-15">^</a></b></span> <span class="reference-text">The game, also known as <i>ADVENT</i>, was originally written by Crowther in about 700 lines of FORTRAN code; Knuth recast it into the WEB idiom. It is available at <a rel="nofollow" class="external text" href="http://www.literateprogramming.com/cweb_download.html">literateprogramming.com</a> or on <a rel="nofollow" class="external text" href="https://cs.stanford.edu/~knuth/programs.html">Knuth's website</a> <a rel="nofollow" class="external text" href="https://web.archive.org/web/20080820091137/http://sunburn.stanford.edu/~knuth/programs.html">Archived</a> August 20, 2008, at the <a href="Wayback_Machine" title="Wayback Machine">Wayback Machine</a>.</span>
</li>
<li id="cite_note-16"><span class="mw-cite-backlink"><b><a href="#cite_ref-16">^</a></b></span> <span class="reference-text"><cite id="CITEREFde_Marneffe1973" class="citation report cs1"><a href="Pierre-Arnoul_de_Marneffe" title="Pierre-Arnoul de Marneffe">de Marneffe, Pierre Arnoul</a> (December 1973). <a rel="nofollow" class="external text" href="https://github.com/holon-scribe/holon-programming">Holon Programming – A Survey</a> (Report). <a href="University_of_Li%C3%A8ge" title="University of Liège">Université de Liège</a>, Service d'Informatique. p. 135 – via <a href="GitHub" title="GitHub">GitHub</a>.</cite></span>
</li>
<li id="cite_note-17"><span class="mw-cite-backlink"><b><a href="#cite_ref-17">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://orgmode.org/worg/org-contrib/babel/intro.html">"Babel: Introduction"</a>.</cite></span>
</li>
<li id="cite_note-18"><span class="mw-cite-backlink"><b><a href="#cite_ref-18">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://orgmode.org/worg/org-contrib/babel/languages.html#langs">"Babel Languages: redirect"</a>. <i>OrgMode.org</i>.</cite></span>
</li>
<li id="cite_note-19"><span class="mw-cite-backlink"><b><a href="#cite_ref-19">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://orgmode.org/worg/org-contrib/babel/intro.html#literate-programming">"Babel: Introduction"</a>.</cite></span>
</li>
<li id="cite_note-20"><span class="mw-cite-backlink"><b><a href="#cite_ref-20">^</a></b></span> <span class="reference-text"><cite id="CITEREFAshkenas" class="citation web cs1">Ashkenas, Jeremy. <a rel="nofollow" class="external text" href="https://coffeescript.org/#literate">"Literate CoffeeScript"</a><span class="reference-accessdate">. Retrieved <span class="nowrap">November 13,</span> 2014</span>.</cite></span>
</li>
<li id="cite_note-21"><span class="mw-cite-backlink"><b><a href="#cite_ref-21">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://archive.org/details/milestonesincomp0000reil/page/157">Milestones in Computer Science and Information Technology</a> by Edwin D. Reilly, p. 157.</span>
</li>
<li id="cite_note-22"><span class="mw-cite-backlink"><b><a href="#cite_ref-22">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://www.wolfram.com/notebooks/">"Wolfram Notebooks"</a>. <i>Wolfram.com</i><span class="reference-accessdate">. Retrieved <span class="nowrap">November 28,</span> 2018</span>.</cite></span>
</li>
<li id="cite_note-23"><span class="mw-cite-backlink"><b><a href="#cite_ref-23">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.LiterateAgda">"Literate Agda"</a>. <i>Agda Wiki</i><span class="reference-accessdate">. Retrieved <span class="nowrap">March 26,</span> 2017</span>.</cite></span>
</li>
<li id="cite_note-Leisch2002-24"><span class="mw-cite-backlink"><b><a href="#cite_ref-Leisch2002_24-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFLeisch2002" class="citation journal cs1">Leisch, Friedrich (2002). <a rel="nofollow" class="external text" href="https://cran.r-project.org/doc/Rnews/Rnews_2002-3.pdf">"Sweave, Part I: Mixing R and LaTeX: A short introduction to the Sweave file format and corresponding R functions"</a> <span class="cs1-format">(PDF)</span>. <i>R News</i>. <b>2</b> (3): <span class="nowrap">28–</span>31<span class="reference-accessdate">. Retrieved <span class="nowrap">January 22,</span> 2012</span>.</cite></span>
</li>
<li id="cite_note-Pineda-Krch2011-25"><span class="mw-cite-backlink"><b><a href="#cite_ref-Pineda-Krch2011_25-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFPineda-Krch2011" class="citation web cs1">Pineda-Krch, Mario (January 17, 2011). <a rel="nofollow" class="external text" href="http://www.math.ualberta.ca/~mlewis/links/the_joy_of_sweave_v1.pdf">"The Joy of Sweave – A Beginner's Guide to Reproducible Research with Sweave"</a> <span class="cs1-format">(PDF)</span><span class="reference-accessdate">. Retrieved <span class="nowrap">January 22,</span> 2012</span>.</cite></span>
</li>
<li id="cite_note-26"><span class="mw-cite-backlink"><b><a href="#cite_ref-26">^</a></b></span> <span class="reference-text"><cite id="CITEREFXie2015" class="citation book cs1">Xie, Yihui (2015). <a rel="nofollow" class="external text" href="http://www.crcpress.com/product/isbn/9781498716963"><i>Dynamic Documents with R and knitr, 2nd Edition</i></a>. Chapman & Hall/CRC. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>9781498716963</bdi>.</cite></span>
</li>
<li id="cite_note-27"><span class="mw-cite-backlink"><b><a href="#cite_ref-27">^</a></b></span> <span class="reference-text"><cite id="CITEREFXie" class="citation web cs1">Xie, Yihui. <a rel="nofollow" class="external text" href="https://github.com/yihui/knitr/releases/download/doc/knitr-manual.pdf">"knitr: A General-purpose Tool for Dynamic Report Generation in R"</a> <span class="cs1-format">(PDF)</span> – via <a href="GitHub" title="GitHub">GitHub</a>.</cite></span>
</li>
<li id="cite_note-28"><span class="mw-cite-backlink"><b><a href="#cite_ref-28">^</a></b></span> <span class="reference-text"><cite id="CITEREFReam2008" class="citation web cs1">Ream, Edward K. (September 2, 2008). <a rel="nofollow" class="external text" href="http://leoeditor.com/">"Leo's Home Page"</a><span class="reference-accessdate">. Retrieved <span class="nowrap">April 3,</span> 2015</span>.</cite></span>
</li>
<li id="cite_note-29"><span class="mw-cite-backlink"><b><a href="#cite_ref-29">^</a></b></span> <span class="reference-text">See <a rel="nofollow" class="external text" href="http://mirrors.ctan.org/macros/latex/contrib/listings/listings.pdf">listings manual</a> for an overview.</span>
</li>
<li id="cite_note-30"><span class="mw-cite-backlink"><b><a href="#cite_ref-30">^</a></b></span> <span class="reference-text"><cite id="CITEREFMountbatten" class="citation web cs1">Mountbatten, Sian. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20130120154432/http://www.poenikatu.co.uk/html/Web68man.html">"Web 68: Literate programming with ALGOL 68"</a>. Archived from <a rel="nofollow" class="external text" href="http://www.poenikatu.co.uk/html/Web68man.html">the original</a> on January 20, 2013<span class="reference-accessdate">. Retrieved <span class="nowrap">January 1,</span> 2013</span>.</cite></span>
</li>
<li id="cite_note-31"><span class="mw-cite-backlink"><b><a href="#cite_ref-31">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://web.archive.org/web/20180822123639/http://www.tei-c.org/release/doc/tei-p5-doc/en/html/USE.html#IMGD">"TEI Guidelines"</a>. <i>TEI-C.org</i>. TEI Consortium. Archived from <a rel="nofollow" class="external text" href="http://www.tei-c.org/release/doc/tei-p5-doc/en/html/USE.html#IMGD">the original</a> on August 22, 2018<span class="reference-accessdate">. Retrieved <span class="nowrap">August 23,</span> 2018</span>.</cite></span>
</li>
</ol></div></div>
<div class="mw-heading mw-heading2"><h2 id="Further_reading">Further reading</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239549316">
/* start https://en.wikipedia.org/ */
.mw-parser-output .refbegin{margin-bottom:0.5em}.mw-parser-output .refbegin-hanging-indents>ul{margin-left:0}.mw-parser-output .refbegin-hanging-indents>ul>li{margin-left:0;padding-left:3.2em;text-indent:-3.2em}.mw-parser-output .refbegin-hanging-indents ul,.mw-parser-output .refbegin-hanging-indents ul li{list-style:none}@media(max-width:720px){.mw-parser-output .refbegin-hanging-indents>ul>li{padding-left:1.6em;text-indent:-1.6em}}.mw-parser-output .refbegin-columns{margin-top:0.3em}.mw-parser-output .refbegin-columns ul{margin-top:0}.mw-parser-output .refbegin-columns li{page-break-inside:avoid;break-inside:avoid-column}@media screen{.mw-parser-output .refbegin{font-size:90%}}
/* end https://en.wikipedia.org/ */
</style><div class="refbegin" style="">
<ul><li><cite id="CITEREFSewell1989" class="citation news cs1">Sewell, Wayne (1989). <span class="id-lock-registration" title="Free registration required"><a rel="nofollow" class="external text" href="https://archive.org/details/weavingprogramli0000sewe">"Weaving a Program: Literate Programming in WEB"</a></span>. Van Nostrand Reinhold. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>0-442-31946-0</bdi>.</cite></li>
<li><cite id="CITEREFKnuth1992" class="citation book cs1"><a href="Donald_Knuth" title="Donald Knuth">Knuth, Donald E.</a> (1992). <i>Literate Programming</i>. <a href="Stanford_University" title="Stanford University">Stanford University</a> Center for the Study of Language and Information. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-0-937073-80-3</bdi>.</cite></li>
<li><cite id="CITEREFGurari1994" class="citation book cs1">Gurari, Eitan M. (1994). <i>TeX & LaTeX: Drawing and Literate Programming</i>. McGraw Hill. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>0-07-911616-7</bdi>.</cite> (includes software)</li>
<li><cite id="CITEREFNørmark1998" class="citation web cs1">Nørmark, Kurt (August 13, 1998). <a rel="nofollow" class="external text" href="http://www.cs.aau.dk/~normark/litpro/issues-and-problems.html">"Literate Programming – Issues and Problems"</a>. <a href="University_of_Aalborg" class="mw-redirect" title="University of Aalborg">University of Aalborg</a>.</cite></li>
<li><cite id="CITEREFSchulte2012" class="citation news cs1">Schulte, Eric (January 2012). <a rel="nofollow" class="external text" href="https://www.jstatsoft.org/article/view/v046i03/v46i03.pdf">"A Multi-Language Computing Environment for Literate Programming and Reproducible Research"</a> <span class="cs1-format">(PDF)</span>. <i>Journal of Statistical Software</i>. Vol. 46, no. 3. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.18637%2Fjss.v046.i03">10.18637/jss.v046.i03</a></span>.</cite></li>
<li><cite id="CITEREFMall" class="citation web cs1">Mall, Daniel. <a rel="nofollow" class="external text" href="http://literateprogramming.com/">"Literate Programming"</a>.</cite></li>
<li><cite id="CITEREFWalsh2002" class="citation conference cs1">Walsh, Norman (October 15, 2002). <a rel="nofollow" class="external text" href="https://web.archive.org/web/20080511181057/http://www.idealliance.org/papers/xml02/dx_xml02/papers/06-01-01/06-01-01.html"><i>Literate Programming in XML</i></a>. XML 2002. <a href="CiteSeerX_(identifier)" class="mw-redirect" title="CiteSeerX (identifier)">CiteSeerX</a> <span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.537.6728">10.1.1.537.6728</a></span>. Archived from <a rel="nofollow" class="external text" href="http://www.idealliance.org/papers/xml02/dx_xml02/papers/06-01-01/06-01-01.html">the original</a> on May 11, 2008.</cite></li></ul>
</div>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<ul><li><a rel="nofollow" class="external text" href="https://wiki.c2.com/?LiterateProgramming">LiterateProgramming</a> at <a href="WikiWikiWeb" title="WikiWikiWeb">WikiWikiWeb</a></li>
<li><a rel="nofollow" class="external text" href="https://www.ctan.org/tex-archive/help/comp.programming.literate_FAQ">Literate Programming FAQ</a> at <a href="CTAN" title="CTAN">CTAN</a></li></ul>
<div class="navbox-styles"><style data-mw-deduplicate="TemplateStyles:r1129693374">
/* start https://en.wikipedia.org/ */
.mw-parser-output .hlist dl,.mw-parser-output .hlist ol,.mw-parser-output .hlist ul{margin:0;padding:0}.mw-parser-output .hlist dd,.mw-parser-output .hlist dt,.mw-parser-output .hlist li{margin:0;display:inline}.mw-parser-output .hlist.inline,.mw-parser-output .hlist.inline dl,.mw-parser-output .hlist.inline ol,.mw-parser-output .hlist.inline ul,.mw-parser-output .hlist dl dl,.mw-parser-output .hlist dl ol,.mw-parser-output .hlist dl ul,.mw-parser-output .hlist ol dl,.mw-parser-output .hlist ol ol,.mw-parser-output .hlist ol ul,.mw-parser-output .hlist ul dl,.mw-parser-output .hlist ul ol,.mw-parser-output .hlist ul ul{display:inline}.mw-parser-output .hlist .mw-empty-li{display:none}.mw-parser-output .hlist dt::after{content:": "}.mw-parser-output .hlist dd::after,.mw-parser-output .hlist li::after{content:" · ";font-weight:bold}.mw-parser-output .hlist dd:last-child::after,.mw-parser-output .hlist dt:last-child::after,.mw-parser-output .hlist li:last-child::after{content:none}.mw-parser-output .hlist dd dd:first-child::before,.mw-parser-output .hlist dd dt:first-child::before,.mw-parser-output .hlist dd li:first-child::before,.mw-parser-output .hlist dt dd:first-child::before,.mw-parser-output .hlist dt dt:first-child::before,.mw-parser-output .hlist dt li:first-child::before,.mw-parser-output .hlist li dd:first-child::before,.mw-parser-output .hlist li dt:first-child::before,.mw-parser-output .hlist li li:first-child::before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child::after,.mw-parser-output .hlist dd dt:last-child::after,.mw-parser-output .hlist dd li:last-child::after,.mw-parser-output .hlist dt dd:last-child::after,.mw-parser-output .hlist dt dt:last-child::after,.mw-parser-output .hlist dt li:last-child::after,.mw-parser-output .hlist li dd:last-child::after,.mw-parser-output .hlist li dt:last-child::after,.mw-parser-output .hlist li li:last-child::after{content:")";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li::before{content:" "counter(listitem)"\a0 "}.mw-parser-output .hlist dd ol>li:first-child::before,.mw-parser-output .hlist dt ol>li:first-child::before,.mw-parser-output .hlist li ol>li:first-child::before{content:" ("counter(listitem)"\a0 "}
/* end https://en.wikipedia.org/ */
</style><style data-mw-deduplicate="TemplateStyles:r1236075235">
/* start https://en.wikipedia.org/ */
.mw-parser-output .navbox{box-sizing:border-box;border:1px solid #a2a9b1;width:100%;clear:both;font-size:88%;text-align:center;padding:1px;margin:1em auto 0}.mw-parser-output .navbox .navbox{margin-top:0}.mw-parser-output .navbox+.navbox,.mw-parser-output .navbox+.navbox-styles+.navbox{margin-top:-1px}.mw-parser-output .navbox-inner,.mw-parser-output .navbox-subgroup{width:100%}.mw-parser-output .navbox-group,.mw-parser-output .navbox-title,.mw-parser-output .navbox-abovebelow{padding:0.25em 1em;line-height:1.5em;text-align:center}.mw-parser-output .navbox-group{white-space:nowrap;text-align:right}.mw-parser-output .navbox,.mw-parser-output .navbox-subgroup{background-color:#fdfdfd}.mw-parser-output .navbox-list{line-height:1.5em;border-color:#fdfdfd}.mw-parser-output .navbox-list-with-group{text-align:left;border-left-width:2px;border-left-style:solid}.mw-parser-output tr+tr>.navbox-abovebelow,.mw-parser-output tr+tr>.navbox-group,.mw-parser-output tr+tr>.navbox-image,.mw-parser-output tr+tr>.navbox-list{border-top:2px solid #fdfdfd}.mw-parser-output .navbox-title{background-color:#ccf}.mw-parser-output .navbox-abovebelow,.mw-parser-output .navbox-group,.mw-parser-output .navbox-subgroup .navbox-title{background-color:#ddf}.mw-parser-output .navbox-subgroup .navbox-group,.mw-parser-output .navbox-subgroup .navbox-abovebelow{background-color:#e6e6ff}.mw-parser-output .navbox-even{background-color:#f7f7f7}.mw-parser-output .navbox-odd{background-color:transparent}.mw-parser-output .navbox .hlist td dl,.mw-parser-output .navbox .hlist td ol,.mw-parser-output .navbox .hlist td ul,.mw-parser-output .navbox td.hlist dl,.mw-parser-output .navbox td.hlist ol,.mw-parser-output .navbox td.hlist ul{padding:0.125em 0}.mw-parser-output .navbox .navbar{display:block;font-size:100%}.mw-parser-output .navbox-title .navbar{float:left;text-align:left;margin-right:0.5em}body.skin--responsive .mw-parser-output .navbox-image img{max-width:none!important}@media print{body.ns-0 .mw-parser-output .navbox{display:none!important}}
/* end https://en.wikipedia.org/ */
</style></div><div role="navigation" class="navbox" aria-labelledby="Programming_paradigms_(Comparison_by_language)368" style="padding:3px"><table class="nowraplinks mw-collapsible autocollapse navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tbody><tr><th scope="col" class="navbox-title" colspan="2"><style data-mw-deduplicate="TemplateStyles:r1239400231">
/* start https://en.wikipedia.org/ */
.mw-parser-output .navbar{display:inline;font-size:88%;font-weight:normal}.mw-parser-output .navbar-collapse{float:left;text-align:left}.mw-parser-output .navbar-boxtext{word-spacing:0}.mw-parser-output .navbar ul{display:inline-block;white-space:nowrap;line-height:inherit}.mw-parser-output .navbar-brackets::before{margin-right:-0.125em;content:"[ "}.mw-parser-output .navbar-brackets::after{margin-left:-0.125em;content:" ]"}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbar a>span,.mw-parser-output .navbar a>abbr{text-decoration:inherit}.mw-parser-output .navbar-mini abbr{font-variant:small-caps;border-bottom:none;text-decoration:none;cursor:inherit}.mw-parser-output .navbar-ct-full{font-size:114%;margin:0 7em}.mw-parser-output .navbar-ct-mini{font-size:114%;margin:0 4em}html.skin-theme-clientpref-night .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}@media(prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}}@media print{.mw-parser-output .navbar{display:none!important}}
/* end https://en.wikipedia.org/ */
</style><div id="Programming_paradigms_(Comparison_by_language)368" style="font-size:114%;margin:0 4em"><a href="Programming_paradigm" title="Programming paradigm">Programming paradigms</a> (<a href="Comparison_of_multi-paradigm_programming_languages" title="Comparison of multi-paradigm programming languages">Comparison by language</a>)</div></th></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Imperative_programming" title="Imperative programming">Imperative</a></th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"></div><table class="nowraplinks navbox-subgroup" style="border-spacing:0"><tbody><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Structured_programming" title="Structured programming">Structured</a></th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Jackson_structured_programming" title="Jackson structured programming">Jackson structures</a></li>
<li><a href="Block_(programming)" title="Block (programming)">Block-structured</a></li>
<li><a href="Modular_programming" title="Modular programming">Modular</a></li>
<li><a href="Non-structured_programming" title="Non-structured programming">Non-structured</a></li>
<li><a href="Procedural_programming" title="Procedural programming">Procedural</a></li>
<li><a href="Programming_in_the_large_and_programming_in_the_small" title="Programming in the large and programming in the small">Programming in the large and in the small</a></li>
<li><a href="Design_by_contract" title="Design by contract">Design by contract</a></li>
<li><a href="Invariant-based_programming" title="Invariant-based programming">Invariant-based</a></li>
<li><a href="Nested_function" title="Nested function">Nested function</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Object-oriented_programming" title="Object-oriented programming">Object-oriented</a><br>(<a href="Comparison_of_programming_languages_(object-oriented_programming)" title="Comparison of programming languages (object-oriented programming)">comparison</a>, <a href="List_of_object-oriented_programming_languages" title="List of object-oriented programming languages">list</a>)</th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Class-based_programming" title="Class-based programming">Class-based</a>, <a href="Prototype-based_programming" title="Prototype-based programming">Prototype-based</a>, <a href="Object-based_language" title="Object-based language">Object-based</a></li>
<li><a href="Agent-oriented_programming" title="Agent-oriented programming">Agent</a></li>
<li><a href="Immutable_object" title="Immutable object">Immutable object</a></li>
<li><a href="Persistent_programming_language" title="Persistent programming language">Persistent</a></li>
<li><a href="Uniform_function_call_syntax" title="Uniform function call syntax">Uniform function call syntax</a></li></ul>
</div></td></tr></tbody></table><div></div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Declarative_programming" title="Declarative programming">Declarative</a></th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"></div><table class="nowraplinks navbox-subgroup" style="border-spacing:0"><tbody><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Functional_programming" title="Functional programming">Functional</a><br>(<a href="Comparison_of_functional_programming_languages" title="Comparison of functional programming languages">comparison</a>)</th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Recursion_(computer_science)" title="Recursion (computer science)">Recursive</a></li>
<li><a href="Anonymous_function" title="Anonymous function">Anonymous function</a> (<a href="Partial_application" title="Partial application">Partial application</a>)</li>
<li><a href="Higher-order_programming" title="Higher-order programming">Higher-order</a></li>
<li><a href="Purely_functional_programming" title="Purely functional programming">Purely functional</a></li>
<li><a href="Total_functional_programming" title="Total functional programming">Total</a></li>
<li><a href="Strict_programming_language" title="Strict programming language">Strict</a></li>
<li><a href="Generalized_algebraic_data_type" title="Generalized algebraic data type">GADTs</a></li>
<li><a href="Dependent_type" title="Dependent type">Dependent types</a></li>
<li><a href="Functional_logic_programming" title="Functional logic programming">Functional logic</a></li>
<li><a href="Tacit_programming" title="Tacit programming">Point-free style</a></li>
<li><a href="Expression-oriented_programming_language" title="Expression-oriented programming language">Expression-oriented</a></li>
<li><a href="Applicative_programming_language" title="Applicative programming language">Applicative</a>, <a href="Concatenative_programming_language" title="Concatenative programming language">Concatenative</a></li>
<li><a href="Function-level_programming" title="Function-level programming">Function-level</a>, <a href="Value-level_programming" title="Value-level programming">Value-level</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Dataflow_programming" title="Dataflow programming">Dataflow</a></th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Flow-based_programming" title="Flow-based programming">Flow-based</a></li>
<li><a href="Reactive_programming" title="Reactive programming">Reactive</a> (<a href="Functional_reactive_programming" title="Functional reactive programming">Functional reactive</a>)</li>
<li><a href="Signal_programming" class="mw-redirect" title="Signal programming">Signals</a></li>
<li><a href="Stream_processing" title="Stream processing">Streams</a></li>
<li><a href="Synchronous_programming_language" title="Synchronous programming language">Synchronous</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Logic_programming" title="Logic programming">Logic</a></th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Abductive_logic_programming" title="Abductive logic programming">Abductive logic</a></li>
<li><a href="Answer_set_programming" title="Answer set programming">Answer set</a></li>
<li><a href="Constraint_programming" title="Constraint programming">Constraint</a> (<a href="Constraint_logic_programming" title="Constraint logic programming">Constraint logic</a>)</li>
<li><a href="Inductive_logic_programming" title="Inductive logic programming">Inductive logic</a></li>
<li><a href="Nondeterministic_programming" title="Nondeterministic programming">Nondeterministic</a></li>
<li><a href="Ontology_language" title="Ontology language">Ontology</a></li>
<li><a href="Probabilistic_logic_programming" title="Probabilistic logic programming">Probabilistic logic</a></li>
<li><a href="Query_language" title="Query language">Query</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Domain-specific_language" title="Domain-specific language">DSL</a></th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Algebraic_modeling_language" title="Algebraic modeling language">Algebraic modeling</a></li>
<li><a href="Array_programming" title="Array programming">Array</a></li>
<li><a href="Automata-based_programming" title="Automata-based programming">Automata-based</a> (<a href="Action_language" title="Action language">Action</a>)</li>
<li><a href="Command_language" title="Command language">Command</a> (<a href="Spacecraft_command_language" title="Spacecraft command language">Spacecraft</a>)</li>
<li><a href="Differentiable_programming" title="Differentiable programming">Differentiable</a></li>
<li><a href="End-user_development" title="End-user development">End-user</a></li>
<li><a href="Grammar-oriented_programming" title="Grammar-oriented programming">Grammar-oriented</a></li>
<li><a href="Interface_description_language" title="Interface description language">Interface description</a></li>
<li><a href="Language-oriented_programming" title="Language-oriented programming">Language-oriented</a></li>
<li><a href="List_comprehension" title="List comprehension">List comprehension</a></li>
<li><a href="Low-code_development_platform" title="Low-code development platform">Low-code</a></li>
<li><a href="Modeling_language" title="Modeling language">Modeling</a></li>
<li><a href="Natural-language_programming" class="mw-redirect" title="Natural-language programming">Natural language</a></li>
<li><a href="Non-English-based_programming_languages" title="Non-English-based programming languages">Non-English-based</a></li>
<li><a href="Page_description_language" title="Page description language">Page description</a></li>
<li><a href="Pipeline_(software)" title="Pipeline (software)">Pipes</a> and <a href="Filter_(software)" title="Filter (software)">filters</a></li>
<li><a href="Probabilistic_programming" title="Probabilistic programming">Probabilistic</a></li>
<li><a href="Quantum_programming" title="Quantum programming">Quantum</a></li>
<li><a href="Scientific_programming_language" title="Scientific programming language">Scientific</a></li>
<li><a href="Scripting_language" title="Scripting language">Scripting</a></li>
<li><a href="Set_theoretic_programming" title="Set theoretic programming">Set-theoretic</a></li>
<li><a href="Simulation_language" title="Simulation language">Simulation</a></li>
<li><a href="Stack-oriented_programming" title="Stack-oriented programming">Stack-based</a></li>
<li><a href="System_programming_language" title="System programming language">System</a></li>
<li><a href="Tactile_programming_language" title="Tactile programming language">Tactile</a></li>
<li><a href="Template_processor" title="Template processor">Templating</a></li>
<li><a href="Transformation_language" title="Transformation language">Transformation</a> (<a href="Graph_rewriting" title="Graph rewriting">Graph rewriting</a>, <a href="Production_system_(computer_science)" title="Production system (computer science)">Production</a>, <a href="Pattern_matching" title="Pattern matching">Pattern</a>)</li>
<li><a href="Visual_programming_language" title="Visual programming language">Visual</a></li></ul>
</div></td></tr></tbody></table><div></div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Concurrent_computing" title="Concurrent computing">Concurrent</a>,<br><a href="Distributed_computing" title="Distributed computing">distributed</a>,<br><a href="Parallel_computing" title="Parallel computing">parallel</a></th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Actor_model" title="Actor model">Actor-based</a></li>
<li><a href="Automatic_mutual_exclusion" title="Automatic mutual exclusion">Automatic mutual exclusion</a></li>
<li><a href="Choreographic_programming" title="Choreographic programming">Choreographic programming</a></li>
<li><a href="Concurrent_logic_programming" title="Concurrent logic programming">Concurrent logic</a> (<a href="Concurrent_constraint_logic_programming" title="Concurrent constraint logic programming">Concurrent constraint logic</a>)</li>
<li><a href="Concurrent_object-oriented_programming" title="Concurrent object-oriented programming">Concurrent OO</a></li>
<li><a href="Macroprogramming" title="Macroprogramming">Macroprogramming</a></li>
<li><a href="Multitier_programming" title="Multitier programming">Multitier programming</a></li>
<li><a href="Organic_computing" title="Organic computing">Organic computing</a></li>
<li><a href="Parallel_programming_model" title="Parallel programming model">Parallel programming models</a></li>
<li><a href="Partitioned_global_address_space" title="Partitioned global address space">Partitioned global address space</a></li>
<li><a href="Process-oriented_programming" title="Process-oriented programming">Process-oriented</a></li>
<li><a href="Relativistic_programming" title="Relativistic programming">Relativistic programming</a></li>
<li><a href="Service-oriented_programming" title="Service-oriented programming">Service-oriented</a></li>
<li><a href="Structured_concurrency" title="Structured concurrency">Structured concurrency</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Metaprogramming" title="Metaprogramming">Metaprogramming</a></th><td class="navbox-list-with-group navbox-list navbox-even hlist" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Attribute-oriented_programming" title="Attribute-oriented programming">Attribute-oriented</a></li>
<li><a href="Automatic_programming" title="Automatic programming">Automatic</a> (<a href="Inductive_programming" title="Inductive programming">Inductive</a>)</li>
<li><a href="Dynamic_programming_language" title="Dynamic programming language">Dynamic</a></li>
<li><a href="Extensible_programming" title="Extensible programming">Extensible</a></li>
<li><a href="Generic_programming" title="Generic programming">Generic</a></li>
<li><a href="Homoiconicity" title="Homoiconicity">Homoiconicity</a></li>
<li><a href="Interactive_programming" title="Interactive programming">Interactive</a></li>
<li><a href="Macro_(computer_science)" title="Macro (computer science)">Macro</a> (<a href="Hygienic_macro" title="Hygienic macro">Hygienic</a>)</li>
<li><a href="Metalinguistic_abstraction" title="Metalinguistic abstraction">Metalinguistic abstraction</a></li>
<li><a href="Multi-stage_programming" title="Multi-stage programming">Multi-stage</a></li>
<li><a href="Program_synthesis" title="Program synthesis">Program synthesis</a> (<a href="Bayesian_program_synthesis" title="Bayesian program synthesis">Bayesian</a>, <a href="Inferential_programming" title="Inferential programming">Inferential</a>, <a href="Programming_by_demonstration" title="Programming by demonstration">by demonstration</a>, <a href="Programming_by_example" title="Programming by example">by example</a>)</li>
<li><a href="Reflective_programming" title="Reflective programming">Reflective</a></li>
<li><a href="Self-modifying_code" title="Self-modifying code">Self-modifying code</a></li>
<li><a href="Symbolic_programming" title="Symbolic programming">Symbolic</a></li>
<li><a href="Template_metaprogramming" title="Template metaprogramming">Template</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Separation_of_concerns" title="Separation of concerns">Separation<br>of concerns</a></th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Aspect-oriented_programming" title="Aspect-oriented programming">Aspects</a></li>
<li><a href="Component-based_software_engineering" title="Component-based software engineering">Components</a></li>
<li><a href="Data-driven_programming" title="Data-driven programming">Data-driven</a></li>
<li><a href="Data-oriented_design" title="Data-oriented design">Data-oriented</a></li>
<li><a href="Event-driven_programming" title="Event-driven programming">Event-driven</a></li>
<li><a href="Feature-oriented_programming" title="Feature-oriented programming">Features</a></li>
<li><a href="Role-oriented_programming" title="Role-oriented programming">Roles</a></li>
<li><a href="Subject-oriented_programming" title="Subject-oriented programming">Subjects</a></li></ul>
</div></td></tr></tbody></table></div>
<div class="navbox-styles"></div><div role="navigation" class="navbox" aria-labelledby="Donald_Knuth92" style="padding:3px"><table class="nowraplinks hlist mw-collapsible autocollapse navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tbody><tr><th scope="col" class="navbox-title" colspan="2"><div id="Donald_Knuth92" style="font-size:114%;margin:0 4em"><a href="Donald_Knuth" title="Donald Knuth">Donald Knuth</a></div></th></tr><tr><th scope="row" class="navbox-group" style="width:1%">Publications</th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><i><a href="The_Art_of_Computer_Programming" title="The Art of Computer Programming">The Art of Computer Programming</a></i></li>
<li>"<a href="The_Complexity_of_Songs" title="The Complexity of Songs">The Complexity of Songs</a>"</li>
<li><i><a href="Computers_and_Typesetting" title="Computers and Typesetting">Computers and Typesetting</a></i></li>
<li><i><a href="Concrete_Mathematics" title="Concrete Mathematics">Concrete Mathematics</a></i></li>
<li><i><a href="Surreal_Numbers_(book)" class="mw-redirect" title="Surreal Numbers (book)">Surreal Numbers</a></i></li>
<li><i><a href="Things_a_Computer_Scientist_Rarely_Talks_About" title="Things a Computer Scientist Rarely Talks About">Things a Computer Scientist Rarely Talks About</a></i></li>
<li><i><a href="Selected_papers_series_of_Knuth" title="Selected papers series of Knuth">Selected papers series</a></i></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Software" title="Software">Software</a></th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="TeX" title="TeX">TeX</a></li>
<li><a href="Metafont" title="Metafont">Metafont</a></li>
<li>MIXAL (<a href="MIX_(abstract_machine)" title="MIX (abstract machine)">MIX</a></li>
<li><a href="MMIX" title="MMIX">MMIX</a>)</li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Font" title="Font">Fonts</a></th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="AMS_Euler" title="AMS Euler">AMS Euler</a></li>
<li><a href="Computer_Modern" title="Computer Modern">Computer Modern</a></li>
<li><a href="Concrete_Roman" title="Concrete Roman">Concrete Roman</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"></th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Web_(programming_system)" title="Web (programming system)">WEB</a></li>
<li><a href="CWEB" class="mw-redirect" title="CWEB">CWEB</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Algorithm" title="Algorithm">Algorithms</a></th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Knuth's_Algorithm_X" title="Knuth's Algorithm X">Knuth's Algorithm X</a></li>
<li><a href="Knuth%E2%80%93Bendix_completion_algorithm" title="Knuth–Bendix completion algorithm">Knuth–Bendix completion algorithm</a></li>
<li><a href="Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm" title="Knuth–Morris–Pratt algorithm">Knuth–Morris–Pratt algorithm</a></li>
<li><a href="Fisher%E2%80%93Yates_shuffle" title="Fisher–Yates shuffle">Knuth shuffle</a></li>
<li><a href="Robinson%E2%80%93Schensted%E2%80%93Knuth_correspondence" title="Robinson–Schensted–Knuth correspondence">Robinson–Schensted–Knuth correspondence</a></li>
<li><a href="Trabb_Pardo%E2%80%93Knuth_algorithm" class="mw-redirect" title="Trabb Pardo–Knuth algorithm">Trabb Pardo–Knuth algorithm</a></li>
<li>Generalization of <a href="Dijkstra's_algorithm" title="Dijkstra's algorithm">Dijkstra's algorithm</a></li>
<li><a href="Knuth's_Simpath_algorithm" title="Knuth's Simpath algorithm">Knuth's Simpath algorithm</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Other</th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Dancing_Links" title="Dancing Links">Dancing Links</a></li>
<li><a href="Knuth_reward_check" title="Knuth reward check">Knuth reward check</a></li>
<li><a href="Knuth_Prize" title="Knuth Prize">Knuth Prize</a></li>
<li><a href="Knuth's_up-arrow_notation" title="Knuth's up-arrow notation">Knuth's up-arrow notation</a></li>
<li><a href="Man_or_boy_test" title="Man or boy test">Man or boy test</a></li>
<li><a href="Quater-imaginary_base" title="Quater-imaginary base">Quater-imaginary base</a></li>
<li><a href="-yllion" title="-yllion">-yllion</a></li>
<li><a href="Potrzebie#System_of_measurement" title="Potrzebie">Potrzebie system of weights and measures</a></li></ul>
</div></td></tr></tbody></table></div></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-08-06" href="https://en.wikipedia.org/wiki/?title=Literate_programming&oldid=1304465242">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>